<?php
/*
	插件概览
*/
defined('BY_JYA') or exit('error');
$_RQ['op']=$_RQ['op']?$_RQ['op']:'main';
if($_RQ['op']=='main'){
	$d=$_RQ['d'];
	if(!$d){
		$d=1;
	}
	if($d==1){
		$t = time();
		$start = mktime(0,0,0,date("m",$t),date("d",$t),date("Y",$t));
		$end = mktime(23,59,59,date("m",$t),date("d",$t),date("Y",$t));
	}elseif
	($d==-1){
		$t = time()-3600*24;
		$start = mktime(0,0,0,date("m",$t),date("d",$t),date("Y",$t));
		$end = mktime(23,59,59,date("m",$t),date("d",$t),date("Y",$t));
	}
	elseif
	($d==7){
		$t = time();
		$start = mktime(0,0,0,date("m",$t),date("d",$t),date("Y",$t))-3600*24*6;
		$end = mktime(23,59,59,date("m",$t),date("d",$t),date("Y",$t));
	}
	elseif
	($d==30){
		$t = time();
		$start = mktime(0,0,0,date("m",$t),date("d",$t),date("Y",$t))-3600*24*29;
		$end = mktime(23,59,59,date("m",$t),date("d",$t),date("Y",$t));
	}
	
	$return['res']['pay']=pdo_count('jy_jdk_orders',array('uniacid'=>$_SESSION['uniacid'],'status'=>1,'mid'=>$_SESSION['uid'],'createtime between'=>array($start,$end)));
	$return['res']['yg']=pdo_count('jy_jdk_orders',array('uniacid'=>$_SESSION['uniacid'],'status'=>1,'mid'=>$_SESSION['uid'],'createtime between'=>array($start,$end)));
	$return['res']['js']=pdo_count('jy_jdk_orders',array('uniacid'=>$_SESSION['uniacid'],'status'=>3,'mid'=>$_SESSION['uid'],'createtime between'=>array($start,$end)));
	$return['res']['shouru']=pdo_getsum('jy_jdk_orders',array('uniacid'=>$_SESSION['uniacid'],'status'=>1,'mid'=>$_SESSION['uid'],'createtime between'=>array($start,$end)),'price');
	$return['d']=$d;
	exi($return);
}
